package main

import "fmt"
import "time"

type Usber interface {
	start()
	stop()
}
type Phone struct {
	Name string
}
type Camera struct {
	Name      string
	PhotoTime string
}

func (p Phone) start() {
	fmt.Println(p.Name, "正在开机....")
}
func (p Camera) start() {
	fmt.Println(p.Name, "按下了拍照键....")
}
func (p Phone) stop() {
	fmt.Println(p.Name, "5秒后自动关闭")
}
func (p Camera) stop() {
	fmt.Println(p.Name, "拍照完毕,时间:", p.PhotoTime)
}
func (p Camera) run() {
	fmt.Println(p.Name, "环境切换")
}
func main() {
	p := Phone{
		Name: "红米手机",
	}
	p.start()
	time.Sleep(2000)
	p.stop()
	q := Camera{
		Name:      "中型相机",
		PhotoTime: "2022-9-14 19:20:01",
	}
	q.start()
	q.stop()
	var p1 Usber
	p1 = p
	p1.run()
	var c1 Usber = q
	c1.start()
	c1.run()
}
